# 虚拟环境位置 -- D:\virtualENV3.5.2\ENV
# -*- coding: utf-8 -*-
# @Time    : 2017/11/29 9:40
# @Author  : wdm
# @Site    : 
# @File    : html_data_dao.py
# @Software: PyCharm

# 数据入库
import pymongo
from bson.objectid import ObjectId
host = '127.0.0.1'
port = 27017
connection = pymongo.MongoClient(host, port,)
db = connection.spiderData
db_col = db["spiderData"]

def insert_data(map):
    db_col.insert(map)
def get_data_by_ischeck():
    return  db_col.find({"is_check":"0"})
def update_ischeck(id):
    #print(db_col.find_one({'_id':ObjectId("5a1eb63746f4196b48a541e5")}))
    db_col.update({"_id":ObjectId(id)},{"$set":{"is_check":"1"}})


